package com.example.demo;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class Function {
    DBConnection DBConn = new DBConnection();
    public boolean CheckLogin(Connection conn, String s1,String s2) throws
            SQLException{
        Statement stmt =conn.createStatement();
        ResultSet rs=null;
        boolean OK = true;
        String AdminPWd="";
        String USer=CheckReplace(s1);
        String Pwd=CheckReplace(s2);
        String Sql="select * from admin where AdminName='"+USer +"'";
        rs=stmt.executeQuery(Sql);
        if(!rs.next()){
            OK=false;
        }else{
            AdminPWd=rs.getString("AdminPwd");
            OK=Pwd.equals(AdminPWd);
        }
        return  OK;


    }
}
